﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace WiseLink.RDS.Web.Common
{
    
    public class RDSWebConfig : ConfigurationSection 
    {
        public static RDSWebConfig GetConfig()
        {
            return ConfigurationManager.GetSection("RDSWebSettings") as RDSWebConfig;
        }
        
        [ConfigurationProperty("AllowedIDS", IsRequired = true)]
        public AllowedIDSElement AllowedIDS 
        {
            get { return (AllowedIDSElement)this["AllowedIDS"]; }
            set { this["AllowedIDS"] = value; }
        }
        public class AllowedIDSElement : ConfigurationElement
        {
            [ConfigurationProperty("name", DefaultValue = "1;2;3", IsRequired = true)]
            //[StringValidator(InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 60)]
            public String Name
            {
                get
                {
                    return (String)this["name"];
                }
                set
                {
                    this["name"] = value;
                }
            }

        }
    }
}